<script>
    $(document).ready(function()
    {
        $(".tab_content").hide();
        $("ul.tabs li:first").addClass("active").show();
        $(".tab_content:first").show();

        $("ul.tabs li").click(function()
        {
            $("ul.tabs li").removeClass("active");
            $(this).addClass("active");
            $(".tab_content").hide();

            var activeTab = $(this).find("a").attr("href");
            $(activeTab).fadeIn();
            return false;
        });
        $('.menu_link').click(function(){
            
            if(this.title=="Portafolio"){
                $('#select-bar').load("<?php echo $this->Html->url(array('controller' => 'PortfolioProyects', 'action' => 'select_portfolio')) ?>");
                $('#content').html("");
                
            }else{
                $('#select-bar').load("<?php echo $this->Html->url(array('controller' => 'Proyects', 'action' => 'select_proyect')) ?>");
                $('#content').html("");
            }
            
        });
        
    });

</script>

<div id="tabs-container" >
    <ul class="tabs">
        <?php foreach ($lista as $tab): ?>
            <li><?php echo $this->Ajax->link($tab['Tab']['titulo'], array('controller' => 'Menus', "action" => "ver", $tab['Tab']['id']), array('update' => 'menu', 'indicator' => 'loading', 'class' => "menu_link", 'title' => $tab['Tab']['titulo'])) ?></li>
        <?php endforeach; ?>
    </ul>
</div>